<!DOCTYPE html>
<html>
<head>
    <title>接口注册管理</title>
    <#include "/common/import.ftl" >
</head>
<body>
<table class="info" cellspacing="1" cellpadding="0">
        <#assign x=0 />
<tr>
    <#list cacheKeys as temp>
        <#assign x=temp_index+1 />
        <#if x%4==0></tr>
        <tr></#if>
        <td>
            <font color="red"> ${temp}</font>
            (
            <a href="javascript:void('0')"
               onclick="showRestartDialog('${temp}')">查看</a>｜<a
                href="javascript:void('0')"
                onclick="delCache('${temp}')">删除</a>)
        </td>
    </#list>
</tr>
</table>
<div id="restartDialog" class="easyui-dialog" title="查看缓存信息" style="width: 600px; height: 200px;"
     data-options="iconCls:'pag-list',modal:true,collapsible:false,minimizable:false,maximizable:false,resizable:false,closed:true">
    <div id="viewCache">
    </div>
</div>
<script>
    function showRestartDialog(id) {
        var url = "${ctx}/viewCache?type=cache&id=" + id;
        $.ajax({
            type: "get",
            url: url,
            dataType: "text",
            success: function (data) {
                $("#viewCache").html(data);
                $("#restartDialog").dialog('open');
            },
            error: function (messg) {
                $.messager.alert('错误提示', '操作失败:' + messg.responseText, 'error');
            }
        });
    }

    function delCache(key) {
        var url = "${ctx}/delCache?id=" + key;
        $.ajax({
            type: "get",
            url: url,
            dataType: "json",
            success: function (data) {
                $.messager.alert('信息提示', data.msg, 'info');
                window.location.reload();
            },
            error: function (messg) {
                $.messager.alert('错误提示', '操作失败:' + messg.responseText, 'error');
            }
        });
    }
</script>
</body>
</html>